
CFLAGS=-I../libipq -g
LDFLAGS=-L../libipq

LIBS=-lipq
OBJS=bloom_filter.o type_routingtable.o type_announce.o typecast-routing.o util.o typecast_config.o LBF_update.o ipq_process.o


test_OBJS = test.o bloom_filter.o typecast_config.o util.o type_routingtable.o


CC=gcc


all: typecast-routing test test_broadcast test_LBF_update typecast_client typecast_server


typecast-routing: ${OBJS}
	${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} -o $@ $(LIBS)

bloom_filter.o: bloom_filter.c
	$(CC) $(CFLAGS) -c -o $@ $<

type_routingtable.o: type_routingtable.c
	$(CC) $(CFLAGS) -c -o $@ $<

type_announce.o: type_announce.c
	$(CC) $(CFLAGS) -c -o $@ $<

util.o: util.c
	$(CC) $(CFLAGS) -c -o $@ $<

typecast_config.o: typecast_config.c
	$(CC) $(CFLAGS) -c -o $@ $<

LBF_update.o: LBF_update.c
	$(CC) $(CFLAGS) -c -o $@ $<

ipq_process.o: ipq_process.c
	$(CC) $(CFLAGS) -c -o $@ $<



test.o: test.c
	$(CC) $(CFLAGS) -c -o $@ $<
	
test_broadcast.o: test_broadcast.c
	$(CC) $(CFLAGS) -c -o $@ $<

test_LBF_update.o: test_LBF_update.c
	$(CC) $(CFLAGS) -c -o $@ $<

typecast_client.o: typecast_client.c
	$(CC) $(CFLAGS) -c -o $@ $<

typecast_server.o: typecast_server.c
	$(CC) $(CFLAGS) -c -o $@ $<


test: ${test_OBJS}
	$(CC) $(CFLAGS) ${test_OBJS} -o $@ 

test_broadcast: test_broadcast.o
	$(CC) $(CFLAGS) test_broadcast.o -o $@ 

test_LBF_update: test_LBF_update.o
	$(CC) $(CFLAGS) test_LBF_update.o bloom_filter.o util.o -o $@ 

typecast_client: typecast_client.o
	$(CC) $(CFLAGS) typecast_client.o bloom_filter.o util.o -o $@ 

typecast_server: typecast_server.o
	$(CC) $(CFLAGS) typecast_server.o bloom_filter.o util.o -o $@ 


typecast-routing.o: typecast-routing.c
	$(CC) $(CFLAGS) -c -o $@ $<

clean: 
	rm -f typecast-routing test *.o


